//
//  LCEssenceTableViewCell.m
//  段子手
//
//  Created by dllo on 16/3/23.
//  Copyright © 2016年 JokesTeam. All rights reserved.
//

#import "LCEssenceTableViewCell.h"

@interface LCEssenceTableViewCell ()

@property (nonatomic, retain) UIImageView *imgV;
@property (nonatomic, retain) UILabel *labelTitle;

@end

@implementation LCEssenceTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self create];
    }
    return self;
}

- (void)setModel:(LCEssenceModel *)model{
    
    _model = model;
    
    [_imgV sd_setImageWithURL:[NSURL URLWithString:_model.image_url]];
    
    _labelTitle.text = _model.title;
    
}




- (void)create{
    
    self.imgV = [[UIImageView alloc]initWithFrame:CGRectMake(20, 10, 110, 80)];
    [self.contentView addSubview:_imgV];
    
    self.labelTitle = [[UILabel alloc]initWithFrame:CGRectMake(_imgV.frame.size.width  + _imgV.frame.origin.x + 10, _imgV.frame.origin.y +3, SCREENW - _imgV.frame.size.width - 50, 50)];
    [self.contentView addSubview:_labelTitle];
    _labelTitle.font = [UIFont systemFontOfSize:13];
    _labelTitle.numberOfLines = 2;
}




- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
